package cn.java68.aop;

import cn.java68.service.User;
import cn.java68.service.UserService;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import java.util.Arrays;

public class AopTest {
    public static void main(String[] args) {
        ApplicationContext ac=new ClassPathXmlApplicationContext("app*.xml");
        UserService us=(UserService)ac.getBean("userService");
        System.out.println("类名:"+us.getClass().getName());
        System.out.println("父类:"+us.getClass().getSuperclass());
        System.out.println("接口:"+ Arrays.toString(us.getClass().getInterfaces()));
        //$1 extends UserService
        /**
         * get(){
         *     super.get(id);
         *
         * }
         */
        boolean f=us.add(new User(1099,"李金哲",26));
        System.out.println(f);

        User user=us.get(1999);
        System.out.println(user);
    }
}
